import React from 'react';
import {useRoutes} from 'react-router-dom'
import routes from './router/routeConfig'
import RouterBeforeEach from './router/RouterBeforeEach';

import './App.css';

//class组件, 组件内有this(表示当前组件实例), 组件内有状态(state), 组件内有生命周期函数
//函数组件, 组件内没有this, 组件内没有状态, 没有生命周期函数

function App() {
  return (
    <div className="App">
      {/* 渲染路由规则 */}
      { useRoutes(routes) }
      <RouterBeforeEach/>
    </div>
  );
}

export default App;
